
import 'dart:convert';

import 'package:flutter/services.dart';

import 'huaweimap_platform_interface.dart';

class Huaweimap {
  final methodChannel = const MethodChannel('huaweimap');
  void addListenNotice(Function(String str) callback){
    methodChannel.setMethodCallHandler((MethodCall call) async {
      // 根据收到的方法名和参数进行处理
      if (call.method == 'addListenNotice') {
        callback(jsonEncode(call.arguments));
      } else {

      }
    });
  }

  void addListenOhosLogin(Function(String str) callback){
    methodChannel.setMethodCallHandler((MethodCall call) async {
      // 根据收到的方法名和参数进行处理
      if (call.method == 'addListenOhosLogin') {
        callback(jsonEncode(call.arguments));
      } else {

      }
    });
  }
  Future<String?> ohosMapSelectAddress() {
    return HuaweimapPlatform.instance.ohosMapSelectAddress();
  }
  Future<String?> ohosAccountLogin(String marks) {
    return HuaweimapPlatform.instance.ohosAccountLogin(marks);
  }
  Future<String?> ohosMapMarker(String marks) {
    return HuaweimapPlatform.instance.ohosMapMarker(marks);
  }
  Future<String?> ohosMapTranceOverLay(String marks) {
    return HuaweimapPlatform.instance.ohosMapTranceOverLay(marks);
  }
}
